package com.ssh.action.petinfo;

import javax.annotation.Resource;

import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;

import com.opensymphony.xwork2.ActionSupport;
import com.ssh.biz.IPetinfoBiz;
import com.ssh.entity.Petinfo;
@Controller
@Scope("prototype")
public class EditPetAction extends ActionSupport{
	@Resource
	private IPetinfoBiz iPetinfoBiz;
	
	private Petinfo petinfo;
	private String petName;
	private String petSex;
	private Integer petStrength;
	private Integer petCute;
	private Integer petLove;
	private String petIntro;
	private String petOwnerName;
	private String petOwnerEmail;
	private String petPassword;
	private String petPic;
	private Integer petType;
	private int petId;
	
	public String execute(){
		
		petinfo = iPetinfoBiz.findPetByID(petId);
		
		petinfo.setPetCute(petCute);
		petinfo.setPetIntro(petIntro);
		petinfo.setPetLove(petLove);
		petinfo.setPetName(petName);
		petinfo.setPetOwnerEmail(petOwnerEmail);
		petinfo.setPetOwnerName(petOwnerName);
		petinfo.setPetPassword(petPassword);
		petinfo.setPetPic(petPic);
		petinfo.setPetSex(petSex);
		petinfo.setPetStrength(petStrength);
		petinfo.setPetType(petType);
		
		iPetinfoBiz.updatePet(petinfo);
		return "success";
	}
	
	
	public IPetinfoBiz getiPetinfoBiz() {
		return iPetinfoBiz;
	}
	public void setiPetinfoBiz(IPetinfoBiz iPetinfoBiz) {
		this.iPetinfoBiz = iPetinfoBiz;
	}
	public Petinfo getPetinfo() {
		return petinfo;
	}
	public void setPetinfo(Petinfo petinfo) {
		this.petinfo = petinfo;
	}


	public String getPetName() {
		return petName;
	}


	public void setPetName(String petName) {
		this.petName = petName;
	}


	public String getPetSex() {
		return petSex;
	}


	public void setPetSex(String petSex) {
		this.petSex = petSex;
	}


	public Integer getPetStrength() {
		return petStrength;
	}


	public void setPetStrength(Integer petStrength) {
		this.petStrength = petStrength;
	}


	public Integer getPetCute() {
		return petCute;
	}


	public void setPetCute(Integer petCute) {
		this.petCute = petCute;
	}


	public Integer getPetLove() {
		return petLove;
	}


	public void setPetLove(Integer petLove) {
		this.petLove = petLove;
	}


	public String getPetIntro() {
		return petIntro;
	}


	public void setPetIntro(String petIntro) {
		this.petIntro = petIntro;
	}


	public String getPetOwnerName() {
		return petOwnerName;
	}


	public void setPetOwnerName(String petOwnerName) {
		this.petOwnerName = petOwnerName;
	}


	public String getPetOwnerEmail() {
		return petOwnerEmail;
	}


	public void setPetOwnerEmail(String petOwnerEmail) {
		this.petOwnerEmail = petOwnerEmail;
	}


	public String getPetPassword() {
		return petPassword;
	}


	public void setPetPassword(String petPassword) {
		this.petPassword = petPassword;
	}


	public String getPetPic() {
		return petPic;
	}


	public void setPetPic(String petPic) {
		this.petPic = petPic;
	}


	public Integer getPetType() {
		return petType;
	}


	public void setPetType(Integer petType) {
		this.petType = petType;
	}


	public int getPetId() {
		return petId;
	}


	public void setPetId(int petId) {
		this.petId = petId;
	}


	

}
